package com.huage_05.lesson_03;

import java.util.Arrays;

public class StringArray {
    public static void main(String[] args) {
        String str = "91 27 46 38 50";
        System.out.println("待处理字符串:" + str);
        String[] arr = str.split(" ");
        int[] a = new int[arr.length];
        for (int i=0;i<arr.length;i++){
            a[i] = Integer.parseInt(arr[i]);
        }
        Arrays.sort(a);
        StringBuilder sb = new StringBuilder();
        for (int i=0;i<a.length;i++){
            if(i==a.length-1){
                sb.append(a[i]);
            }else {
                sb.append(a[i]).append(" ");
            }
        }
        String s = sb.toString();
        System.out.println("处理后字符串:" + s);

      /*  String s = Arrays.toString(a);
        System.out.println("s = " + s);
        String ss = s.replace(","," ").substring(1,s.length()-1);
        System.out.println("处理后字符串:" + ss);*/
    }
}
